$.post(Feng.ctxPath + "/payService/getDepartment", function (data) {//把数据渲染到archiving_content容器里面//初始化科室下拉框
    var listr = "";
    for(var i=0;i<data.length;i++){
        listr += '<div style="width: 20%"><span class="pay_list_c1 projectDatas">' +
            '<input class="radioclass" type="radio" value="'+data[i].department+'" name="about" id="click_'+data[i].department+'"></span>' +
            '<label for="click_'+data[i].department+'" style="font-weight: 500;margin-left: 10px;">'+data[i].department+'</label></div>';
    }
    document.getElementById('treatmentUnitBox').innerHTML = listr;
}, "json");

$("#treatmentUnitBox").on('click', '.projectDatas', function () {
    $(this).parent().parent().find(".pay_list_c1").css("background", "#DCDCDC");
    $(this).css("background", "#289bd6");
});

$("#treatmentUnitBox").on('click', '.projectData', function () {
    $(this).parent().parent().find(".pay_list_c1").css("background", "#DCDCDC");
    $(this).siblings().css("background", "#289bd6");
});

$("#submission").click(function () {
    var initialization = $("input[name='about']:checked").val();
    var customerId = $("#customerId").val();
    if(initialization == "" || initialization == null){
        alert("请选择一个科室！");
    }else {
        $.ajax({
            url: Feng.ctxPath + "/customer/add_TreatmentUnitValue",
            type: "post",
            data: {
                "initialization": initialization,
                "customerId": customerId
            },
            success: function (data) {
                Feng.success("添加成功!");
                window.parent.Customer.table.refresh();
                parent.layer.close(parent.layer.getFrameIndex(window.name));
            }
        });
    }
});